<template>
    <view class="capacity">
        <u-cell-group>
            <u-cell-item icon="play-circle"
                         @tap="goToVideo(item)"
                         v-for="(item,index) in dataArr" :key="item.cameraCode"
                         :title="item.cameraName"></u-cell-item>
        </u-cell-group>
    </view>
</template>

<script>
    import { $http } from '../../static/common/js/http.js'
    export default {
        data() {
            return {
                dataArr: []
            }
        },
        computed: {
        },
        onShow() {
        },
        onLoad() {
            this.getData()
        },
        methods: {
            goToVideo(item){
                uni.navigateTo({
                    url: '/pages/example/video?cameraCode=' + item.cameraCode + '&cameraName='+ item.cameraName
                })
            },
            getData(){
                const vm = this
                uni.showLoading({
                    title: '加载中'
                });
                $http('/fenghuoImp/indexAct/app/cameras.html', 'post', {

                    },
                    res => {
                        console.log(res,'9999')
                        vm.dataArr = res.data
                        uni.hideLoading();
                    },
                    err => {
                        console.log(err,'err')
                    }
                )
            },
            updateData(e){
                this.activeMenu = e;
                this.chartData = JSON.parse(JSON.stringify(this.chartData))
            }
        }
    }
</script>

<style lang="scss" scoped>
    .capacity {
        width: 100%;
        margin-bottom: 30rpx;
    }
</style>
